Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
amp-orbs is the dispatch program Amp's orb provider runs on an always-on provider sandbox: it starts, pauses (saving a project snapshot) and deletes one instabox sandbox per Amp thread with the instabox CLI. It imports Amp's orb image as the base snapshot every day. orbs.rs mints a workspace key, creates or repairs the provider and installs the program with the key sent as exec env. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Amp mode offers Amp orbs in the list. The page sets up the provider sandbox, opens the sign-in terminal on it, shows its status, rebuilds the orb image and removes it all. Orb and provider rows say what they are, open their thread or the page, and have no ADE, power or delete actions. Free plans get a paid-plan notice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The key renewed only while the Amp orbs page was open. The app now reads the provider's status when it lists the provider and twice a day, so the key renews in its last 30 days while InstaADE runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is well documented and broadly tested, but teardown and key-rotation failure paths can strand live resources or privileged credentials.
Requirements context
I assessed the PR against its description, docs/amp-orbs.md, README.md, and DEVELOPMENT.md; no linked issue or separate design specification was provided. The documented contract requires removal to refuse while any orb remains, purge managed snapshots, revoke the workspace key, and then delete the provider; repair must rotate and revoke the previous key.
The paid-workspace/Amp-sign-in end-to-end flow and the explicitly unverified Amp CLI behavior remain outside this local review.
Findings
Critical
-
Removal can delete the provider while a live orb still exists.
orbs_removecounts orbs from the app's cached machine list and passes that count intoremove; the removal implementation never refreshes the list from the API. More importantly, the provider remains active between this check andpurge, so Amp can spawn an orb after even a fresh check. The provider and key can then be deleted while that orb remains, stranding a potentially running, billable sandbox that Amp can no longer manage. Stop dispatch first and verify the authoritative machine list after it can no longer spawn, restoring the service if removal must be refused. Add a regression test for a stale/concurrent orb. (src-tauri/src/app.rs:5446-5474,src-tauri/src/orbs.rs:464-497) -
Repair and removal silently lose the key ID when provider status fails or is malformed. Both paths convert status errors or an unparsable response into
None. Repair then installs a new key without revoking the prior full machine/image key; removal proceeds to delete the provider without revoking it. This violates the documented rotation/removal contract and leaves 365-day privileged credentials active with no remaining in-app recovery path. Status failure must either block the destructive operation or the key must be recoverable and revoked through an authoritative API-side mechanism. (src-tauri/src/orbs.rs:370-440,src-tauri/src/orbs.rs:482-497) -
Snapshot deletion failures do not fail removal.
purgelogs each failedsnapshot rmand still exits successfully. Rust therefore revokes the key and deletes the provider, leaving failed-to-delete base/project snapshots behind and making the cleanup impossible to retry through the Amp-orbs UI. Since removal explicitly promises to purge these snapshots, aggregate deletion failures and return a nonzero result before destroying the provider. (src-tauri/assets/amp-orbs/amp-orbs:347-363,src-tauri/src/orbs.rs:488-497)
Suggestion
(none)
Information
- Software engineering/architecture: module boundaries follow the existing Rust-command/React-UI design, and the new behavior has substantial unit/UI coverage. The critical failure and race cases above are not covered.
- Security: beyond the orphaned privileged-key issue above, no additional reportable input-validation, secret-logging, authentication, or authorization defect was detected.
- Performance: no reportable N+1 access, unbounded hot-path work, UI event-loop blocking, or excessive allocation issue was detected.
- Readability and documentation are generally strong, and the Rust/TypeScript state representations remain synchronized.
Tests
timeout --kill-after=10s 120s bun run typecheck— environment failure:bunwas unavailable.timeout --kill-after=10s 120s bun run test -- src/App.test.tsx— environment failure:bunwas unavailable.timeout --kill-after=10s 120s cargo test orbs --lib— environment failure: Cargo's default registry cache was read-only.timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s npx --yes [email protected] install --frozen-lockfile— dependency setup failed because that Bun release could not read lockfile version 2; no tracked file changed.timeout --kill-after=10s 120s npm install --no-save --no-package-lock --ignore-scripts— completed; used only to create ignored local dependencies because the available Bun could not consume the lockfile.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" cargo test orbs --lib— environment failure before tests: the VM lacks theglib-2.0development package required by Tauri's Linux dependencies.timeout --kill-after=10s 120s npm run typecheck— passed.timeout --kill-after=10s 120s npm run test -- src/App.test.tsx— passed, 160 tests.timeout --kill-after=10s 120s npm run test— passed, 255 tests across 11 files.timeout --kill-after=10s 120s npm run build— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.git diff --check— passed.cargo clippy --all-targets -- -D warnings— skipped after Cargo compilation established that the required GLib development package is unavailable.- Paid-workspace setup, Amp sign-in, real thread spawn/pause/delete, and removal were not exercised because they require external accounts/services explicitly unavailable to this review.
- Final
git status --shortandgit diff --name-onlywere clean; testing changed no tracked files.
Verdict
Request changes. The three Critical teardown and credential-lifecycle defects must be addressed before merge.
Removal could delete the provider while Amp started an orb, could lose the
key when the provider's status failed, and went on when purge left a
snapshot. Now each step must succeed before the next one:
- Removal stops dispatch, then reads the sandboxes from the API. With an
orb left it starts dispatch again and refuses.
- Repair and removal find the keys of Amp orbs by name in the workspace's
key list (GET /v1/orgs/{id}/keys), not in the provider's status. A key
that stays valid fails the step, so Repair or Remove can try again.
- purge counts the snapshots and builder it cannot delete, and fails when
one stays. The provider then stays, so a second removal can try again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The feature is well structured and documented, but two correctness defects block merge because they can strand removal or connect the provider with the wrong token.
Requirements context
Intent was derived from the PR description, docs/amp-orbs.md, README.md, and DEVELOPMENT.md. The review assessed setup/repair, scoped-key rotation, Amp sign-in, metadata-safe dispatch, snapshot handling, loss-safe removal, UI integration, security, and performance.
Findings
Critical
-
Removal cannot be retried after provider deletion fails. The flow purges snapshots, revokes every workspace key, and only then deletes the provider (
src-tauri/src/orbs.rs:543-545). If that final API deletion fails transiently, the documented retry rerunspurge, but the provider now has only the revoked key;ib snapshot lsconsequently fails and prevents the retry from ever reaching provider deletion (src-tauri/assets/amp-orbs/amp-orbs:360-378). This violates the documented promise that a failed step can be retried and leaves an always-on provider stranded unless the user discovers a separate repair/manual-deletion workaround (docs/amp-orbs.md:73-80). Preserve enough state/credentials to retry, or make the post-revocation retry able to complete safely, and add a regression covering “purge and revoke succeed, provider deletion fails, second removal succeeds.” -
Sign-in treats any saved orb-provider token as the
instaboxtoken.read_tokenselects the first secret whose key starts withorb-provider-token@, without tying it to the active Amp endpoint or the provider being configured (src-tauri/assets/amp-orbs/amp-orbs:260-278). Therefore, whensecrets.jsoncontains another provider/account endpoint token,connectskipsamp orb provider create instabox, andserveexports that unrelated token (src-tauri/assets/amp-orbs/amp-orbs:287-295). A two-entry JSON reproduction returned the unrelated first token. This can make setup report completion without creating a usableinstaboxprovider. Identify the exact token created for this provider/active endpoint and test coexistence with another saved token.
Suggestion
- Reduce credential exposure during runtime installation. Setup executes
instabox@latestand a downloaded Amp installer while the delete-capable workspace key remains inherited in the process environment (src-tauri/src/orbs.rs:203-258). Consider pinning/validating runtime dependencies and writing the protected environment file before unsetting the key for installation subprocesses. This improves reproducibility and limits supply-chain exposure.
Information
- Software engineering/architecture: the Rust orchestration, dispatch script, API client, and React presentation are separated consistently with existing project conventions.
- Security beyond the findings: command inputs are generally quoted/validated, orb operations verify role and ID metadata, and the key is sent with
noHistoryand stored mode0600. - Performance: no reportable hot-path, unbounded-read, N+1, or event-loop-blocking issue was found. Status polling is bounded and stops once setup settles.
Tests
timeout --kill-after=10s 120s bun run typecheck— initially failed becausebunwas absent from PATH.timeout --kill-after=10s 120s bun run test -- --run src/App.test.tsx src/types.test.ts— initially failed becausebunwas absent from PATH.timeout --kill-after=10s 120s cargo test orbs:: --lib— initially failed because Cargo’s default cache was read-only.timeout --kill-after=10s 120s cargo test api::tests:: --lib— initially failed because Cargo’s default cache was read-only.- Bun installation into the writable runtime directory — passed.
- Initial
cargo fetch --locked— failed against the read-only default Cargo cache. bun install --frozen-lockfile— passed, 94 packages installed from the lockfile.CARGO_HOME=<writable-runtime-cache> cargo fetch --locked— passed.bun run typecheck— passed.bun run test -- --run src/App.test.tsx src/types.test.ts— passed, 161 tests across 2 files.cargo test orbs:: --lib— environment failure before project compilation: requiredglib-2.0/gobject-2.0development packages are unavailable.cargo test api::tests:: --lib— same environment failure.cargo fmt --check— passed.bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.bun run build— passed.- Targeted
jqreproduction of multi-token selection — completed and selected the unrelated first token. git diff --checkand finalgit status --short— clean; testing changed no tracked files.
The paid-workspace/Amp-sign-in end-to-end flow was not run because it requires a paid workspace, cloud credentials, and an interactive Amp account. Full Rust tests and Clippy remain unverified because the sandbox lacks the required Tauri system libraries, and VM configuration changes were out of scope.
Verdict
Request changes. Both Critical findings affect explicit setup/removal guarantees and should be fixed before merge.
Removal deleted the orb snapshots on the provider with its key. When
deleting the provider failed after the key was revoked, a second removal
could not list the snapshots and never reached the provider. InstaADE now
deletes the import builder and the orb snapshots of the workspace itself,
with the user's sign-in (DELETE /v1/snapshots/{id}), so every step of a
second removal works. The provider only stops dispatch (amp-orbs stop).
The provider ran with the first orb-provider token in Amp's secrets.json,
which could be another Amp server's or another provider's. amp-orbs-connect
now keeps the token that `amp orb provider create instabox` saved for the
Amp server in use, only when it is new, in /var/lib/amp-orbs/provider-token
(mode 0600). serve and status read that file alone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The implementation matches the documented Amp-orbs lifecycle and has no Critical findings; one non-blocking status-display issue remains.
Requirements context
Reviewed against the PR description, docs/amp-orbs.md, README.md, and DEVELOPMENT.md. These define the provider/orb lifecycle, role isolation, workspace-key rotation, token handling, safe removal, paid-plan restriction, and UI behavior. No linked issue or additional design document was identified.
Architecture and project conventions are followed: the React UI uses Rust commands, serialized state is mirrored in TypeScript, and orchestration is isolated in orbs.rs and the provider asset. Security-sensitive inputs are quoted or validated, the workspace key is sent through exec environment fields with history disabled, token/key files use restrictive permissions, and destructive operations check role metadata or workspace ownership. No reportable security or performance issue was detected within the reviewed paths.
Findings
Critical
(none)
Suggestion
src/AmpOrbs.tsx:327-366— The connected-page summary treats every orb that is not currentlyrunningaspaused. Orbs in creating, starting, stopping, error, or other transitional states will therefore produce an inaccurate “N paused” count. Count only the paused/suspended state, or show an additional “other” category.
Information
(none)
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s npx bun run test -- src/App.test.tsx— passed: 160 tests.timeout --kill-after=10s 120s npx bun run typecheck— passed.timeout --kill-after=10s 120s npx bun run build— passed.timeout --kill-after=10s 120s cargo test orbs --lib— environment failure: Cargo’s default registry cache is read-only.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" cargo test orbs --lib— environment failure during compilation: required GLib, GObject, and GIO development packages/pkg-config metadata are absent. No Rust test result was observed.timeout --kill-after=10s 120s npx --yes [email protected] install --frozen-lockfile— failed because Bun 1.3.3 does not understand this lockfile version.timeout --kill-after=10s 120s npx --yes bun@latest install --frozen-lockfile— passed; dependencies installed from the committed lockfile.- Initial
bun run test -- src/App.test.tsxandbun run typecheckattempts were skipped by the shell because Bun was not installed; both passed after the locked dependency installation above. - Paid-workspace setup, interactive Amp sign-in, live spawn/pause/delete, key renewal, and removal E2E were not run because this sandbox has no paid-workspace credentials or interactive Amp account. These are also identified as unverified in the PR description.
git status --shortremained clean after testing; tools changed no tracked files.
Verdict
approved — no Critical findings were found within the reviewed scope.
…bs by state The install ran npm and Amp's install script while the workspace key was in its environment. It now saves the key in /etc/amp-orbs/key, which only root reads, and runs the rest in a new process without the key, so no installer can read it, also not from /proc. The new key replaces the old one only once the install worked. systemd reads the file as root and hands the key to the services (EnvironmentFile). The provider installs instabox 0.8.522, and only when its npm tarball has the hash InstaADE knows. Amp's CLI now comes from npm, checked against the registry, not from a script piped to bash. It stays unpinned: Amp's server and CLI change together. The Amp orbs page called every orb that does not run paused. It now counts each state: "1 running · 1 paused · 1 creating · 1 error". Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The implementation is comprehensive, but the project-snapshot collision can violate Amp’s save-on-pause contract and risks losing an orb’s state.
Requirements context
I assessed the PR against its description, docs/amp-orbs.md, README.md, and DEVELOPMENT.md; no linked issue was supplied. The reviewed scope includes provider setup and key handling, dispatch lifecycle operations, removal/recovery, API additions, sandbox-role isolation, and the React UI.
Findings
Critical
- Concurrent pauses can alias one snapshot and discard an orb’s saved state. Snapshot names use only the project-derived prefix plus
date +%s. If two orbs with the sameORB_SNAPSHOT_IDpause within one second, both request the same name. The second operation explicitly treats a name conflict as success, then polls the first matching snapshot by name and proceeds to suspend its own sandbox. Consequently, Amp can receive a successful pause even though that orb was never snapshotted; after its sandbox is deleted, its changes are unavailable to the next orb for that project. Generate a collision-resistant name and track the snapshot created by this operation rather than accepting an arbitrary existing same-name snapshot. Add a concurrent-pause regression test. (src-tauri/assets/amp-orbs/amp-orbs:181-208)
Suggestion
- Provide a recovery path for a stale saved provider token. Once
provider-tokenexists,connectnever callsamp orb provider createagain. If the provider is removed in Amp or the user changes Amp accounts, opening the sign-in terminal or running Repair continues using the old token, while local status can still reporttokenSavedand the UI can appear connected. Consider validating/rotating the token or exposing an explicit reconnect flow. (src-tauri/assets/amp-orbs/amp-orbs:297-319)
Information
- Security: No additional reportable security issue was detected. The workspace key is sent through exec environment fields with history disabled, installed before old keys are revoked, and kept out of command text. (
src-tauri/src/orbs.rs:483-517) - Performance: No reportable hot-path issue was detected. UI orb counting uses a fixed eight-state scan, and the heavier API/deletion loops are user-triggered administrative flows. (
src/AmpOrbs.tsx:13-21,src-tauri/src/orbs.rs:554-620) - Software engineering: The feature follows the Rust-command/React boundary and includes extensive fake-provider, removal, key, script, and UI tests. End-to-end behavior requiring a paid workspace and real Amp sign-in remains unverified, as disclosed by the PR. (
src-tauri/src/orbs.rs:623-2125,src/App.test.tsx:2778-2940)
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s git diff --check main...HEAD— passed.timeout --kill-after=10s 120s cargo test orbs:: --lib— environment failure: the default Cargo cache is read-only.timeout --kill-after=10s 120s env CARGO_HOME="$XDG_CACHE_HOME/cargo" cargo test orbs:: --lib— environment failure: compilation reachedglib-sysbut the VM lacks theglib-2.0development package.timeout --kill-after=10s 120s bun install --frozen-lockfile— environment failure:bunis not installed. Consequently, TypeScript typecheck, Vitest, and the frontend build were skipped.- Paid-workspace/Amp sign-in end-to-end testing was skipped because it requires external accounts and credentials unavailable within this review environment.
git status --shortremained clean after testing; no tracked files were changed.
Verdict
Request changes. The snapshot-name race is a proven correctness and data-loss risk and must be fixed before merge.
Two orbs of a project that paused in the same second asked for the same snapshot name. The second save took the conflict for success, waited for the first orb's snapshot and paused its own orb unsaved, so its state was lost. A project snapshot's name now ends in a random tag, and a pause follows the snapshot by the id its save gave. A failed save fails the pause. A pause deletes only the snapshots of its project that are older than its own, so a newer one of an orb that paused meanwhile stays. Names keep to 128 characters, also for a long project id. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The PR implements the documented Amp-orbs provider lifecycle across the Rust core, provider dispatch script, API client, and React UI, with no merge-blocking defect found in the reviewed paths.
Requirements context
Intent was derived from the PR description, docs/amp-orbs.md, README.md, and DEVELOPMENT.md; no linked issue or separate design specification was present. The reviewed scope covered provider setup/repair, workspace-key handling and renewal, orb spawn/pause/delete dispatch, image refresh, ordered/retryable removal, sandbox-role integration, and the Amp-orbs UI.
Findings
Critical
(none)
Suggestion
-
src-tauri/assets/amp-orbs/amp-orbs:92-100— Project snapshot namespaces use an eight-hex-digitcksumwhen anORB_SNAPSHOT_IDneeds normalization or truncation. Two distinct IDs with the same sanitized prefix and 32-bit checksum would share snapshots, allowing one project to resume from another project's state. This is unlikely accidentally, but using a longer collision-resistant digest would preserve project isolation even for adversarial or numerous IDs. -
src/AmpOrbs.tsx:453-456— The user-initiated Check again action discards every refresh error, leaving stale status with no feedback when the provider or API cannot be reached. The background polling at lines 312-318 can reasonably remain quiet, but the explicit button should use the existingrunwrapper so failures are surfaced.
Information
- Architecture and maintainability: the feature follows the existing Rust-command/React-client boundary and isolates provider behavior in
orbs.rsandassets/amp-orbs/. No reportable architecture or readability issue was detected within scope. - Security: secret installation uses exec environment fields with
noHistory, root-only key storage, scoped workspace credentials, metadata checks before sandbox mutation, and a pinned integrity value for the instabox CLI. Apart from the snapshot-namespace hardening suggestion above, no reportable security issue was detected. - Performance: workspace lists and cleanup loops occur in infrequent setup/removal paths; UI counting is linear over the displayed sandboxes. No reportable hot-path, unbounded-read, or N+1 issue was detected.
- The PR explicitly identifies paid-workspace and Amp sign-in end-to-end behavior as unverified; this review had neither those credentials nor external services available.
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s npx --yes bun@latest install --frozen-lockfile— passed; installed the pinned frontend dependencies without modifying tracked manifests.timeout --kill-after=10s 120s npx --yes bun@latest run test -- --run src/App.test.tsx src/types.test.ts— passed: 161 tests across 2 files.timeout --kill-after=10s 120s npx --yes bun@latest run typecheck— passed.timeout --kill-after=10s 120s npx --yes bun@latest run build— passed.git diff --check main...HEAD— passed.- Initial
timeout --kill-after=10s 120s cargo test orbs:: --lib— environment failure because Cargo's default registry cache was read-only. - Retried with writable
CARGO_HOMEandCARGO_TARGET_DIR— compilation stopped because the VM lacks theglib-2.0andgobject-2.0development packages required by Tauri. Rust tests were therefore not executed. - Initial Bun test/typecheck attempts failed because
bunand then project dependencies were not installed; both checks passed after the frozen dependency installation above. - Paid-workspace/Amp sign-in end-to-end tests were skipped because the required account, workspace, and Amp credentials were unavailable.
Testing created only ignored build/dependency artifacts; git status --short reported no tracked-file changes.
Verdict
approved — no Critical findings were identified. The suggestions are non-blocking.
Amp names an orb amp-<thread UUID> (amp-01a242cb-... runs thread T-01a242cb-...), not amp-T-<UUID> as the code assumed. The end-to-end test showed it: Open thread did not appear on a real orb. Match the real form in the thread link, the tests, the preview data and the docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Amp passes the thread's orb type to spawn as ORB_TYPE; the provider decides what each name means. Map Amp's own size names (small, medium, large, xlarge/xxlarge, with or without "a1.") and vCPUs x GB names such as 32x64 to instabox sizes. instabox locks a snapshot to the size it was saved at, so an orb from the base or a project snapshot starts at that size; spawn then resizes it with a restart before Amp starts in it. An unknown type fails before any sandbox is made, with the names in the thread's setup log. A new orb that cannot get its size (not on the plan) is deleted; an existing one keeps its files. Without orb types nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/amp-orbs.md now says how to start a thread on an instabox orb from ampcode.com and from the CLI, and shows the setup page, the connected page, the list in Amp mode and an orb's details. The screenshots are of the browser preview (?orbs=setup and ?orbs=connected) at 2x, cropped like the README's. The preview's paused orb is 8 vCPU / 16 GB, as an orb of the large type would be. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is well documented and extensively tested in source, but the workspace-switch and resource-ownership paths contain blocking isolation and data-loss risks.
Requirements context
I assessed the PR against its description, docs/amp-orbs.md, the README/Amp documentation, and the repository conventions in DEVELOPMENT.md. These specify one provider per selected workspace, explicit one-click setup, automatic key renewal, ownership-safe cleanup, and dispatch limited to resources belonging to Amp orbs. No linked issue or separate design document was identified.
Findings
Critical
-
Automatic renewal can create or repair a provider in the wrong workspace.
orbs_refreshcaptures workspace A before awaiting its provider status, but after the await it updates the current state without checking that A is still selected. More importantly, when A's key is due, it callsorbs_context()again, which reads whichever workspace is selected then. If the user switches to paid workspace B while A's status request is in flight, A's status can therefore triggerorbs_installfor B, minting a key and potentially creating a billable always-on provider there without the user choosing setup for B. Keep the captured org and sizes through renewal, or discard the result when the selected org changes; state updates should also be scoped by both account and org. (src-tauri/src/app.rs:5375-5408) -
A machine with no
orgIdis treated as belonging to every workspace.Machine.org_iddefaults to an empty string, whilefind_provider,orbs_of, and builder cleanup accept that empty value for any requested org. Because/v1/machinesis account-wide, a legacy or incomplete response for a provider in workspace A can be reused during setup in B and installed with B's workspace key; removal in B can likewise stop or delete that provider or an unscoped builder. An unknown owner must not be attributed to every selected workspace—resolve the actual personal workspace explicitly or refuse workspace-sensitive operations when ownership is unknown. (src-tauri/src/orbs.rs:331-351,src-tauri/src/orbs.rs:554-560) -
Image setup/removal can delete an unrelated import builder. The dispatch script deletes any sandbox named
amp-orb-buildercarrying the genericinstabox-importmarker, and removal uses the same name/marker test. A user import created with that builder name has exactly those properties, so setup, a daily rebuild, or removal can destroy the user's unrelated sandbox. Mark the builder with Amp-orbs-specific ownership metadata and require it before deletion, or reject the name collision as setup already does for the provider. (src-tauri/assets/amp-orbs/amp-orbs:395-399,src-tauri/src/orbs.rs:554-560)
Suggestion
- Surface snapshot-retention failures instead of reporting successful maintenance. Failures deleting old project or base snapshots are only logged, so daily imports and pauses can succeed while billable snapshots accumulate indefinitely, contrary to the documented one-base/one-project retention behavior. Consider failing the operation or recording a visible degraded status that Repair can address. (
src-tauri/assets/amp-orbs/amp-orbs:254-264,src-tauri/assets/amp-orbs/amp-orbs:414-423)
Information
- Architecture and maintainability: the provider orchestration is isolated in
orbs.rs, the dispatch implementation is separately embedded, and UI/API types remain synchronized. The large change is cohesive, although its size increases review risk. (src-tauri/src/orbs.rs:1-42,src/types.ts:245-306) - Security beyond the findings above: the workspace key is passed through
envswithnoHistory, written root-only, and removed from the installer environment; I found no additional reportable secret exposure or input-to-shell injection path. (src-tauri/src/orbs.rs:173-323,src-tauri/src/orbs.rs:483-500) - Performance: no reportable hot-path or unbounded-work issue was detected. API machine listing is paginated, and dispatch polling has operation deadlines. (
src-tauri/src/api/mod.rs:275-298,src-tauri/assets/amp-orbs/amp-orbs:94-104)
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.git diff --check main...HEAD— passed.timeout --kill-after=10s 120s bun run typecheck— could not start becausebunis not installed on the VM.timeout --kill-after=10s 120s cargo test orbs:: --lib— could not build because the default Cargo registry cache is read-only.CARGO_HOME=/data/state/codex-review-bot/work/codex-runtime-RPBo9k/cargo-home timeout --kill-after=10s 120s cargo test orbs:: --lib— dependencies downloaded, then the build failed because the VM lacks the requiredglib-2.0system development package.- Shellcheck was unavailable on the VM.
- UI tests/build and Rust unit tests therefore remain unverified. Cloud end-to-end behavior was not exercised because it requires real instabox/Amp accounts and services.
- Testing created only ignored build/cache artifacts; no tracked files changed.
Verdict
Request changes. The workspace-switch renewal race and ambiguous resource ownership can operate on the wrong workspace, while the builder collision can delete unrelated user data. These Critical findings must be addressed before merge.
- A key renewal or setup that ends after the user switched workspaces now acts and shows its steps only in the workspace it started in. - The provider, its orbs and the builder are found only in sandboxes whose orgId is the workspace's. A sandbox without one is in none. - The import builder is amp-orb-builder-<provider id>, passed to the provider in its env file. The image build and removal delete only a builder with that name and the import's mark, never a user's import. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is comprehensive, but the workspace-switch race in automatic key renewal violates an explicit requirement and can eventually stop the provider from starting orbs.
Requirements context
I reviewed the implementation against the PR description, docs/amp-orbs.md, DEVELOPMENT.md, and the existing sandbox/API/UI conventions. The intended scope includes workspace-isolated provider management, automatic renewal of the provider key during its final 30 days—including when the selected workspace changes during a status read—secure installation, orb lifecycle dispatch, cleanup, and the related UI. No linked issue supplied additional requirements.
Findings
Critical
- Renewal is abandoned if the user switches workspaces while status is being read. In
orbs_refresh, the captured workspace’s due key is renewed only when that workspace is still selected after the asynchronous status request completes. If the user switches during that request,hereis false and lines 5432–5447 skip key creation and installation entirely. The recurring UI check for the original provider is also removed after the switch, so renewal may not be retried unless the user later returns to that workspace; the key can consequently expire and prevent Amp from starting orbs. This contradicts the PR description’s guarantee that renewal occurs in the workspace the read was for even if the user switches meanwhile. The regression test currently codifies the broken behavior by asserting that no key is minted despite its name saying the key “renews.” Preserve the captured workspace for renewal while continuing to keep its status and progress out of the newly selected workspace. (src-tauri/src/app.rs:5422-5447,src-tauri/src/app.rs:12745-12772)
Suggestion
(none)
Information
(none)
Beyond the blocking issue above, I found no reportable security defect in the reviewed secret transport, shell-input validation, provider/orb ownership checks, or dependency-install paths. I also found no reportable performance issue: the new list operations are infrequent control-plane work, and the UI’s orb aggregation is bounded by the displayed sandbox list. The new module follows the existing Rust-command/React-client boundary and includes substantial targeted coverage, though the PR is unusually large.
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s sh -n src-tauri/assets/amp-orbs/amp-orbs— passed.git diff --check main...HEAD— passed.timeout --kill-after=10s 120s bun run typecheck— not run successfully: Bun is not installed in the sandbox.timeout --kill-after=10s 120s bun run test -- --run src/App.test.tsx src/types.test.ts— not run successfully: Bun is not installed in the sandbox.timeout --kill-after=10s 120s cargo test orbs --lib— environment failure: Cargo’s default registry cache is read-only.timeout --kill-after=10s 120s env CARGO_HOME=/data/state/codex-review-bot/work/codex-review-68W1BS/codex-runtime-Zm2XaH/cargo cargo test orbs --lib— environment failure during compilation: the VM lacks the requiredglib-2.0/gobject-2.0development libraries. VM configuration was not changed.- Full frontend build, Clippy, and broader Rust tests were not run because they require the same unavailable Bun or native GTK/GLib infrastructure. Cloud end-to-end behavior was not exercised because it requires external accounts and services.
git status --shortremained clean after testing; no tracked files were changed.
Verdict
Request changes. The Critical workspace-switch renewal defect must be fixed before merge.
orbs_refresh skipped the renewal when the user picked another workspace while the provider answered. The key could then expire before the user picked that workspace again, and Amp could start no orb. The refresh now reads the workspace, its plan and its sizes when it starts, and renews the key there whatever is selected when the status comes back. Its steps and status still show only while that workspace is selected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is comprehensive and well tested, but concurrent setup or repair from two clients can violate the key-rotation guarantee and leave a broad workspace key active.
Requirements context
I reviewed against the PR description, docs/amp-orbs.md, DEVELOPMENT.md, and the implementation’s own lifecycle contracts. Together they require one provider per workspace, workspace-scoped discovery, safe secret handling, repair-driven key rotation, removal of every Amp orbs key, role-restricted sandbox operations, orb sizing, snapshot lifecycle management, and UI restrictions for provider/orb sandboxes. No linked issue or separate design document was present.
Findings
Critical
src-tauri/src/orbs.rs:476-481,522-526— Concurrent setup or repair can leave an additional 365-day workspace key active. Each flow lists existing keys before creating its own key, then only revokes IDs from that earlier snapshot. If two InstaADE clients begin setup/repair before either creates its key, neither flow sees the other flow’s key; both can complete, while the provider ultimately uses only the last installed key and the other machine/image-management key remains valid. This violates the stated rotation behavior and the function’s guarantee to revoke every other Amp-orbs key. The lifecycle needs cross-client serialization or another concurrency-safe reconciliation mechanism; a simple localorbs_flowguard only serializes one app instance.
Suggestion
-
src-tauri/src/orbs.rs:515-518— If provider creation or installation fails and revoking the newly minted key also fails, the revocation error is discarded. This can leave a valid broad-scope key behind while showing only the original installation error. Preserve/report the cleanup failure and direct the user to Repair so the remaining key is visible and actionable. -
src-tauri/assets/amp-orbs/amp-orbs:256-265— Snapshot cleanup compares onlycreatedAt < $t. Concurrent project snapshots receiving equal API timestamps are both retained, despite the documented one-snapshot-per-project policy. Consider adding the snapshot name or ID as the same deterministic tie-breaker used bynewest.
Information
-
docs/amp-orbs.md:135— Two troubleshooting bullets are accidentally joined (provider.- **"Amp saved..."**), which makes the rendered instructions harder to scan. -
Architecture and maintainability are otherwise sound: the provider lifecycle is isolated in
src-tauri/src/orbs.rs, dispatch behavior is separated into the installed asset, and the React/Rust state types remain synchronized. Aside from the key races above, I found no additional reportable security issue, untrusted shell interpolation path, authorization weakening, or secret logged in command text. -
I found no reportable performance issue. Status polling is bounded, API listings follow the existing pagination behavior, dispatch polling has deadlines, and no new hot-path N+1 work was identified.
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s bun run test -- src/App.test.tsx src/types.test.ts— initial attempt skipped/failed becausebunwas not installed.timeout --kill-after=10s 120s bun run typecheck— initial attempt skipped/failed becausebunwas not installed.timeout --kill-after=10s 120s cargo test orbs:: --lib— initial attempt failed because Cargo’s default registry cache was read-only.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" CARGO_TARGET_DIR="$TMPDIR/cargo-target" cargo test orbs:: --lib— environment failure while compiling: requiredglib-2.0andgobject-2.0development packages were unavailable. Rust behavioral tests and Clippy therefore remain unverified.timeout --kill-after=10s 120s npm install --global --prefix "$TMPDIR/bun-install" [email protected]— passed, but that Bun version could not parse lockfile version 2.timeout --kill-after=10s 120s "$TMPDIR/bun-install/bin/bun" install --frozen-lockfile— failed due to the unsupported lockfile version.timeout --kill-after=10s 120s npm install --global --prefix "$TMPDIR/bun-install-new" [email protected] && timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" install --frozen-lockfile— passed; 94 locked packages installed.timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" run test -- src/App.test.tsx src/types.test.ts— passed: 161 tests.timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" run typecheck— passed.timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" run build— passed.timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" run test— failed: 254 passed, 1 failed in the unrelatedGitHubSignIn.test.tsxPaseo ordering assertion.timeout --kill-after=10s 120s "$TMPDIR/bun-install-new/bin/bun" run test -- src/GitHubSignIn.test.tsx— passed in isolation: 10 tests, indicating suite interference or an existing flake rather than a demonstrated Amp-orbs regression.- Real Amp/instabox end-to-end flows were not run because they require external accounts and cloud credentials.
git diff --check main...HEADpassed. Testing left no tracked-file changes.
Verdict
Request changes. The concurrent key-rotation race is a blocking security and lifecycle correctness defect; the remaining findings are non-blocking.
Two InstaADE apps that set up, repair or renew at the same time could leave a second 365-day key valid. In another order, one app revoked the key the other then installed, and the provider ran with a revoked key. Both installs also wrote the same key.new file. - The provider installs one key at a time, under a flock held for the whole install. - Keys rank by expiry, then id (key_rank). The provider keeps the newest: an install with an older key than the one it has changes nothing. - Each setup lists the keys after its install and revokes only keys older than its own, and its own when the provider kept a newer one. No setup revokes a newer key, so none revokes the key in use. - A failed install whose new key cannot be revoked says so, with Repair as the next step. - Fix two joined troubleshooting bullets in the docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The feature is comprehensively documented and tested, but removal is not currently safe against concurrent setup or unrelated snapshots using the same broad prefixes.
Requirements context
I assessed the change against the PR description, docs/amp-orbs.md, and the repository conventions in DEVELOPMENT.md. No linked issue or separate design specification was provided; the documented requirements include cross-admin key safety, stopping dispatch before destructive removal, revoking every Amp-orbs key, workspace isolation, and deleting only Amp-orb resources.
Findings
Critical
-
Concurrent repair can undo removal’s safety barrier and leave credentials or resources behind (
src-tauri/src/orbs.rs:523-560,src-tauri/src/orbs.rs:355-360,src-tauri/src/orbs.rs:695-717)Removal captures the key list before stopping dispatch. A setup/repair in another admin’s app can then mint a new key and run the installer, which unconditionally enables and restarts the provider service. One concrete ordering is:
- Removal lists the current keys and stops the provider.
- Concurrent repair creates a new key, installs it, and restarts dispatch.
- Removal’s second machine read sees no orb yet, revokes only its earlier key list, and deletes the provider.
The repair’s new workspace key remains valid because removal never listed it, violating the documented “revokes every Amp orbs key” behavior. Dispatch is also live again after the claimed stop barrier, so an Amp request can create an orb after the final orb check and leave it orphaned when the provider is deleted. The existing
flockserializes installs only; removal neither participates in that exclusion nor leaves a marker that prevents a later installer from restarting services. Coordinate setup and removal across apps, list keys after that exclusion is established, and add a regression test for this interleaving. -
Removal can delete unrelated user snapshots solely because their names share a prefix (
src-tauri/src/orbs.rs:657-668)purgedeletes every workspace snapshot whose name merely starts withamp-orb-base-oramp-orb-snap-. Therefore a user snapshot such asamp-orb-base-my-backuporamp-orb-snap-importantis irreversibly deleted even though this feature could never have created that name. The provider’s own image cleanup already checks the exact timestamp suffix shape insrc-tauri/assets/amp-orbs/amp-orbs:422-430; removal needs an equivalent ownership check, preferably a durable ID/marker, and coverage proving malformed or foreign prefixed snapshots survive.
Suggestion
(none)
Information
- Software engineering and architecture otherwise follow the established Rust-command/React-view boundary, with substantial unit coverage for dispatch, key rotation, workspace filtering, UI behavior, and removal sequencing.
- The security-relevant findings are the leaked-key race and destructive snapshot ownership check above. I found no additional reportable injection, authorization, or secret-logging defect in the reviewed paths.
- I found no reportable performance issue: provider polling is bounded, lifecycle waits have deadlines, and machine listing follows pagination.
Tests
timeout --kill-after=10s 120s npx --yes [email protected] --version— passed; confirmed Bun 1.3.3, but that version was too old for this repository’s lockfile.timeout --kill-after=10s 120s npx --yes [email protected] install --frozen-lockfile— failed because Bun 1.3.3 does not recognize lockfile version 2.timeout --kill-after=10s 120s npx --yes bun --version && timeout --kill-after=10s 120s npx --yes bun install --frozen-lockfile— passed with Bun 1.4.5.timeout --kill-after=10s 120s bun run test -- --run src/App.test.tsx— not run;bunwas not installed directly onPATH.timeout --kill-after=10s 120s bun run typecheck— not run for the same reason.timeout --kill-after=10s 120s npx --yes bun test src/App.test.tsx— failed because this invoked Bun’s native test runner rather than the repository’s Vitest configuration (localStoragewas unavailable); this was an invocation mismatch, not a PR failure.timeout --kill-after=10s 120s npx --yes bun run test -- src/App.test.tsx— passed: 160 tests.timeout --kill-after=10s 120s npx --yes bun run typecheck— passed.timeout --kill-after=10s 120s npx --yes bun run build— passed.timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s cargo test orbs::— first attempt failed because Cargo’s default registry cache was read-only.timeout --kill-after=10s 120s env CARGO_HOME="$XDG_CACHE_HOME/cargo" cargo test orbs::— dependencies downloaded, but compilation failed because the VM lacks theglib-2.0development package. Per the review constraints, I did not alter the VM configuration.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.git diff --check main...HEAD— passed.git status --short— clean; testing changed no tracked files.
Unverified: Rust unit behavior and Clippy beyond formatting, due to the missing system GLib development library; real Amp/instabox integration was not exercised because it requires external accounts and services.
Verdict
Request changes. The concurrent-removal race and overbroad snapshot deletion are blocking correctness, security, and data-loss risks.
…apshots A setup, repair or renewal in another InstaADE could run while a removal ran: it restarted dispatch after the removal's stop, and put a new key in place that the removal, which listed the keys before the stop, never revoked. Removal also deleted every snapshot whose name only started with amp-orb-base- or amp-orb-snap-. - amp-orbs stop takes the install lock and marks the provider as being removed. For 30 minutes an install changes nothing on a marked provider. start clears the mark. - Removal lists the keys after the stop, so a key made meanwhile is revoked too. - purge deletes only snapshots named exactly as amp-orbs names them: amp-orb-base-<time> and amp-orb-snap-<project>-<time>[-<tag>]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs lifecycle is comprehensively implemented and tested, but the provider sandbox exposes privileged credentials through its user-accessible terminal.
Requirements context
I reviewed against the PR description, docs/amp-orbs.md, and the repository conventions in DEVELOPMENT.md. No linked issue was supplied. The intended behavior includes workspace isolation, role/ID ownership checks, safe concurrent key rotation, reversible removal, and keeping the instabox key and Amp provider token isolated on the provider.
Findings
Critical
-
The provider terminal exposes both long-lived credentials to the service account. The installer makes
/var/lib/amp-orbsowned by the current sandbox user and installs the services using that same user (src-tauri/src/orbs.rs:324-325,src-tauri/src/orbs.rs:388-405). The provider token is consequently a mode-0600 file owned by the terminal user (src-tauri/assets/amp-orbs/amp-orbs:329-352). Although the instabox key file is root-only, systemd injects it into a process running as that user (src-tauri/assets/amp-orbs/amp-orb-provider.service:8-14), so the same user can read it from the service process environment under the sandbox's normal/procpolicy. The UI explicitly offers an unrestricted terminal on provider sandboxes (src/AmpOrbs.tsx:202-210,src/SandboxMenu.tsx:248-250).Trigger: any workspace user who can obtain the offered provider terminal runs as the service account. They can directly read the Amp provider token and recover
INSTABOX_API_KEYfrom the provider/image process environment. The key carries workspace-wide machine and image read/write/delete scopes (src-tauri/src/orbs.rs:23-31), which can exceed that member's own authority and allows deleting unrelated sandboxes or snapshots; the Amp token also permits impersonating the provider.Please isolate dispatch and its state under a dedicated non-login account inaccessible to SSH users, with process/credential isolation that prevents terminal users from inspecting its environment. The interactive Amp sign-in can hand the resulting token to that privileged service through a narrow root-owned mechanism. Alternatively, terminal access to the provider must be restricted to principals already authorized for all capabilities carried by these credentials.
Suggestion
(none)
Information
(none)
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed as the first part of the combined shell validation command.shellcheck -s bash src-tauri/assets/amp-orbs/amp-orbs— skipped becauseshellcheckis not installed.timeout --kill-after=10s 120s cargo test orbs:: --lib— environment failure: Cargo's default registry cache is read-only.timeout --kill-after=10s 120s env CARGO_HOME=/data/state/codex-review-bot/work/codex-runtime-3hUnFn/cargo cargo test orbs:: --lib— environment failure while compiling: the sandbox lacks the GLib/GObject development packages required by Linux Tauri.- Same-user
/proc/<pid>/environdiagnostic undertimeout --kill-after=10s 120s— passed, confirming the credential exposure path under this sandbox's process policy. git diff --check main...HEAD— passed.bun run typecheck,bun run test, andbun run build— skipped because Bun andnode_modulesare unavailable.- Full Cargo tests and Clippy — not run after the targeted build failed on the same missing system libraries.
The worktree had no tracked changes after testing. Real Amp/provider integration, real orb-type dispatch, and end-to-end removal were not verified in this environment. Static review found no additional reportable functionality, architecture, performance, or dependency issues within scope.
Verdict
Request changes because the credential exposure is a reachable privilege-escalation and destructive-access risk.
Every member of a team workspace can open a shell on each of its sandboxes, the provider and the orbs too. So every member can read the provider's instabox key, the Amp sign-in of the person who connected it, the provider's Amp token, and the work on each orb. The docs now say so, and that Repair replaces the instabox key after someone leaves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Re: review 6199197819 (credentials on the provider readable from a terminal) We checked this and keep the account model in this PR. The docs now state the exposure.
|
|
InstaADE Preview for 190b47f is ready.
It installs next to InstaADE. Add the preview-build label again to build a newer commit. |
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is comprehensive, but its removal snapshot matcher has a data-loss defect that must be fixed before merge.
Requirements context
I assessed the change against the PR description, docs/amp-orbs.md, DEVELOPMENT.md, and existing sandbox/API conventions. No linked issue was provided. The key removal requirement is that only snapshots named exactly as Amp orbs creates them are deleted; user snapshots that merely resemble those names must remain.
Findings
Critical
- Removal can delete a user-owned base snapshot that Amp orbs never created.
before_stampaccepts both<time>and<time>-<tag>, and the base-snapshot branch reuses that matcher. Consequently, a user snapshot such asamp-orb-base-1800000000-deadbeefis classified as owned, collected bypurge, and deleted. The dispatch program creates base names only asamp-orb-base-<time>; tags belong to project snapshots. This violates the documented deletion boundary and creates a real data-loss path when the user confirms removal. Give base and project names separate validation rules and add a regression test rejecting tagged base names. (src-tauri/src/orbs.rs:208-217,src-tauri/src/orbs.rs:703-710)
Suggestion
(none)
Information
- Software engineering and architecture: the feature is cleanly separated into the Rust orchestration module, provider assets, API extensions, and React UI, with extensive behavioral tests. No additional reportable maintainability issue was detected.
- Security: aside from the destructive matching defect above, I found no reportable issue in the reviewed key isolation, command construction, authorization handling, provider-token storage, dependency installation, or sandbox ownership checks.
- Performance: no reportable hot-path blocking, N+1 behavior, or unbounded application-side processing was detected. Provider polling and API list operations appear proportionate to this workspace-level feature.
Tests
timeout --kill-after=10s 120s bun run test -- src/App.test.tsx— environment failure:bunwas not initially installed.timeout --kill-after=10s 120s bun run typecheck— environment failure:bunwas not initially installed.timeout --kill-after=10s 120s cargo test orbs::— environment failure: Cargo’s default registry cache was read-only.timeout --kill-after=10s 120s npm exec --yes bun -- --version— passed; provided Bun 1.4.5 for local verification.timeout --kill-after=10s 120s npm exec --yes bun -- install --frozen-lockfile— passed.timeout --kill-after=10s 120s npm exec --yes bun -- run test -- src/App.test.tsx— passed, 160 tests.timeout --kill-after=10s 120s npm exec --yes bun -- run typecheck— passed.timeout --kill-after=10s 120s npm exec --yes bun -- run build— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" CARGO_TARGET_DIR="$TMPDIR/instaade-target" cargo test orbs::— environment failure during compilation: the VM lacks the requiredglib-2.0development package/pkg-config entry. Rust tests were therefore unverified.timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s npm exec --yes bun -- run test— passed, 255 tests across 11 files.git diff --check main...HEAD— passed.
Testing created only ignored build/dependency artifacts; git status --short remained clean, with no tracked files changed.
Verdict
Request changes. The Critical snapshot-matching defect can delete user data during Amp-orbs removal.
amp-orbs names a base snapshot amp-orb-base-<time> and gives a tag only to a project snapshot. The removal matcher and spawn's choice of image both took amp-orb-base-<time>-<tag> too, so removal deleted such a snapshot of the user's, and spawn could start orbs from it. A base name now matches only a time, in orb_snapshot and in the program (BASE_STAMP), and image builds prune with the same pattern. Tests cover removal, spawn and the image build's pruning. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D1jxDKXmkbENzwBG6BLsut
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation is well documented and broadly tested, but removal has a blocking recovery dead end when provider restart fails.
Requirements context
Intent was derived from the PR description, commit history, docs/amp-orbs.md, DEVELOPMENT.md, and existing sandbox lifecycle conventions. No linked issue was identified. The review focused on workspace isolation, dispatch behavior, key safety, removal recovery, UI integration, security boundaries, and performance.
Findings
Critical
- A failed restart after detecting a concurrently created orb leaves removal stuck. After stopping dispatch, removal correctly re-lists machines. However, when it finds an orb, it discards the result of
amp-orbs startand returns the ordinary “delete threads in Amp” error (src-tauri/src/orbs.rs:745-755). If that restart fails, dispatch remains disabled and the removal mark remains, so Amp cannot process the thread deletion that would delete the orb. A subsequent removal exits at the initial orb preflight (src-tauri/src/orbs.rs:735-739) without retrying the restart. Recovery then requires waiting for the 30-minute mark to expire and running Repair, or manual intervention. This violates the documented requirement that this race restarts dispatch, clears the mark, and only then refuses removal. Handle the restart failure and ensure a later removal can retry recovery; add a regression test where thestartprogram call fails.
Suggestion
(none)
Information
- Software engineering: Apart from the missing restart-failure regression above, coverage is extensive across API serialization, key races, snapshot ownership, dispatch operations, and UI states (
src-tauri/src/orbs.rs:781-3094,src/App.test.tsx:2779-2940). - Security: No additional reportable issue was found in the reviewed secret transport, shell argument handling, workspace filtering, or ownership-marker paths (
src-tauri/src/orbs.rs:286-434,src-tauri/assets/amp-orbs/amp-orbs:40-313). - Performance: No reportable hot-path or unbounded-work regression was found. Provider polling is bounded and ordinary background checks run twice daily (
src/App.tsx:38-96,src/AmpOrbs.tsx:307-320).
Tests
timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s cargo test orbs::— environment failure: the global Cargo registry cache is read-only.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" cargo test orbs::— environment failure before tests:glib-2.0development metadata is not installed.timeout --kill-after=10s 120s bun run typecheck— could not start becausebunwas absent.timeout --kill-after=10s 120s bun run test -- src/App.test.tsx src/types.test.ts— could not start becausebunwas absent.timeout --kill-after=10s 120s npx --yes [email protected] install --frozen-lockfile— failed because that Bun version cannot read lockfile version 2.timeout --kill-after=10s 120s npx --yes bun@latest install --frozen-lockfile— passed.timeout --kill-after=10s 120s npx --yes bun@latest run typecheck— passed.timeout --kill-after=10s 120s npx --yes bun@latest run test -- src/App.test.tsx src/types.test.ts— passed, 161 tests.timeout --kill-after=10s 120s npx --yes bun@latest run build— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.git diff --check main...HEAD— passed.
Full Rust tests and Clippy were not run because the required GLib system development package is unavailable. Testing created only ignored build/dependency artifacts; no tracked files changed.
Verdict
Request changes. The Critical removal-recovery defect must be fixed before merge.
A removal that found an orb after its stop started dispatch again but ignored a failure. Dispatch then stayed stopped, so Amp could not delete the orb, and the next removal refused at its first orb check without starting it: removal was stuck until the mark expired. Now a failed start says that dispatch is stopped and how to start it. A removal that finds orbs left first starts dispatch when the provider reports it not active, and says so when it does not start. A failed list after the stop says the same when dispatch does not start. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D1jxDKXmkbENzwBG6BLsut
jwfing
left a comment
There was a problem hiding this comment.
Summary
The feature is comprehensive and well tested, but concurrent setup can leave a privileged workspace key valid when provider status cannot be parsed.
Requirements context
Intent was derived from the PR description, docs/amp-orbs.md, DEVELOPMENT.md, and the existing sandbox/API conventions. No linked issue or separate design document was provided. The review covered provider setup/removal, dispatch and snapshots, workspace isolation, key concurrency and secrecy, UI behavior, architecture, security, performance, and test coverage.
Findings
Critical
src-tauri/src/orbs.rs:312-318,src-tauri/src/orbs.rs:630-644— A losing concurrent setup can leave its unused workspace key valid. When the provider already has a newer key, the install script ignores failure fromamp-orbs statusand exits successfully. If that command emits no valid status JSON,parse_statusreturnsNone;lostconsequently remains false and the losing setup does not revoke its own newly minted key. The trigger is two concurrent setups or renewals where the older one loses and its final status command fails or produces malformed output. The impact is an unnecessary 365-day key retaining machine and image read/write/delete scopes, contrary to the documented guarantee that a losing setup revokes its own key. Make the losing branch report its result reliably or fail so the caller revokes that key, and add a regression test for missing/invalid status output.
Suggestion
src-tauri/assets/amp-orbs/amp-orbs:261-270— Snapshot cleanup compares onlycreatedAt < $t. Two project snapshots with the same API timestamp are therefore both retained, despite names already providing a deterministic tie-breaker and the documented intent to keep one project snapshot. Consider applying the same(createdAt, name)ordering used bynewest, deleting every matching snapshot except the newest.
Information
- No additional reportable architecture, readability, security, or performance issues were detected within the review scope. The Rust command boundary, metadata-based ownership checks, secret-bearing exec environment, pinned instabox CLI integrity, bounded polling, and local fake-command tests are consistent with project conventions.
Tests
timeout --kill-after=10s 120s bun run test— failed before execution:bunwas not installed.timeout --kill-after=10s 120s bun run typecheck— failed before execution:bunwas not installed.timeout --kill-after=10s 120s npm exec --yes bun -- --version— passed; supplied Bun 1.4.5 locally.timeout --kill-after=10s 120s npm exec --yes bun -- install --frozen-lockfile— passed; installed the locked dependencies without modifying manifests.timeout --kill-after=10s 120s npm exec --yes bun -- run test— passed: 11 files, 255 tests.timeout --kill-after=10s 120s npm exec --yes bun -- run typecheck— passed.timeout --kill-after=10s 120s npm exec --yes bun -- run build— passed.timeout --kill-after=10s 120s cargo fmt --check— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s cargo test orbs:: --lib— environment failure before compilation: the default Cargo registry cache is read-only.timeout --kill-after=10s 120s sh -c 'CARGO_HOME="$XDG_CACHE_HOME/cargo" cargo test orbs:: --lib'— environment failure during compilation: the VM lacks theglib-2.0development package required by Tauri. No Rust tests completed, so the Rust orchestration and embedded fake-command suites remain unverified here.git diff --check main...HEAD— passed.- Final
git status --shortwas clean; testing changed no tracked files.
Verdict
Request changes because the Critical concurrent-key cleanup defect violates an explicit security and correctness requirement.
When the provider already has a newer key, the install changes nothing and prints the provider's status. The setup took the status as the only sign that it lost, so a status that did not come or did not parse left its new 365-day key valid. The install now prints AMP_ORBS_KEPT_NEWER_KEY before the status, and the setup revokes its own key on that line as well as on a status that names another key. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D1jxDKXmkbENzwBG6BLsut
jwfing
left a comment
There was a problem hiding this comment.
Summary
The Amp-orbs implementation matches its documented setup, dispatch, workspace isolation, credential handling, removal, and UI behavior, with no reportable issues detected within the review scope.
Requirements context
Intent was derived from the PR description and the repository documentation in docs/amp-orbs.md:1-154, with project architecture and verification conventions from DEVELOPMENT.md:1-47. No linked issue was provided.
Findings
Critical
(none)
Suggestion
(none)
Information
- No reportable software-engineering or functionality issues were detected. The implementation follows the existing Rust-command/React-UI boundary and includes focused coverage for setup, workspace switching, concurrent key rotation, removal recovery, dispatch operations, orb sizing, and UI restrictions (
src-tauri/src/orbs.rs:553-825,src-tauri/src/app.rs:5303-5530,src/AmpOrbs.tsx:1-467). - No reportable security issues were detected. Orb operations validate sandbox metadata, installation isolates the workspace key from installer subprocesses, the CLI tarball is integrity-pinned, and removal scopes destructive operations by workspace and constrained names (
src-tauri/assets/amp-orbs/amp-orbs:58-235,src-tauri/src/orbs.rs:266-420,src-tauri/src/orbs.rs:735-825). - No reportable performance issues were detected. Status polling is bounded, API machine listing follows existing pagination, and the new work is user-triggered or infrequent rather than added to a hot request path (
src/App.tsx:38-96,src/AmpOrbs.tsx:298-312,src-tauri/src/api/mod.rs:276-300).
Tests
git diff --check main...HEAD— passed (run twice); no whitespace errors.timeout --kill-after=10s 120s bun run test -- src/App.test.tsx— could not start becausebunwas not installed.timeout --kill-after=10s 120s bun run typecheck— could not start becausebunwas not installed.timeout --kill-after=10s 120s npx --yes bun install --frozen-lockfile— passed; dependencies installed from the existing lockfile.timeout --kill-after=10s 120s npx --yes bun run test -- src/App.test.tsx— passed: 1 file, 160 tests.timeout --kill-after=10s 120s npx --yes bun run typecheck— passed.timeout --kill-after=10s 120s npx --yes bun run build— passed.timeout --kill-after=10s 120s bash -n src-tauri/assets/amp-orbs/amp-orbs— passed.timeout --kill-after=10s 120s cargo test orbs::— environment failure before tests: Cargo's default registry cache was read-only.timeout --kill-after=10s 120s env CARGO_HOME="$TMPDIR/cargo-home" cargo test orbs::— environment failure before PR tests: the image lacks the GLib/GObject development packages required by Tauri's Linux dependencies.
No tracked files were changed by dependency installation or verification. Generated ignored artifacts included dependencies, build output, and Rust compilation caches.
Unverified areas: the Rust tests could not execute in this image, and no live Amp account, instabox workspace, cloud sandbox, image import, orb-type resize, or removal flow was exercised because those require external credentials/services. Review therefore relied on code inspection and the repository's fake-client/script tests for those paths.
Verdict
Approved. There are no Critical findings, so this is ready for human merge consideration.
The line before the power items showed also for a sandbox of Amp orbs, which has no power items, so it sat next to the line before Copy SSH command. It now shows only before the power items. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D1jxDKXmkbENzwBG6BLsut
Removal leaves the instabox provider in Amp, and the sign-in terminal of a new setup then fails: Amp adds no second provider named instabox. amp orb provider ensure, which gives an existing provider a new token, is not available for every Amp account, so the docs say to delete the provider in Amp first, and the troubleshooting lists Amp's error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D1jxDKXmkbENzwBG6BLsut
Adds Amp orbs: InstaADE makes the user's instabox workspace an orb provider for Amp, so each Amp thread runs on its own instabox sandbox. Setup is one click on a paid plan. It needs no change to the instabox backend or to Amp. See
docs/amp-orbs.md.How it works
amp-orb-provider(smallest size, auto sleep off, metadatainstabox-role=amp-orb-provider). It installsamp-orbsand three systemd units, then runsamp orb provider /usr/local/bin/amp-orbsas a service.src-tauri/assets/amp-orbs/amp-orbs, bash). Amp calls it withORB_OPERATION:spawnfinds or creates the thread's orb sandbox, named by Amp's orb IDamp-<thread UUID>, from the project's snapshot, else the newest base snapshot. When the thread picked an orb type (ORB_TYPE), the orb gets that type's size:small,medium,large,xlarge/xxlarge(Amp's size names,a1.optional) or<vCPUs>x<GB>. instabox snapshots are size-locked, so a mismatched orb is resized withinstabox resize --restartbefore Amp starts. An unknown type fails before any sandbox; a new orb that cannot get its size is deleted. Without types: 4 vCPU / 8 GB, as before. Then it startsamp orb bootstrapthere.pausesaves a snapshot when Amp asks for one, then suspends the orb.deletedeletes the orb.instabox-role=amp-orband the matchingamp-orb-id.orgIdis the workspace's; a sandbox without anorgIdis in no workspace.instabox snapshot importimports Amp's official orb image asamp-orb-base-<time>. A daily timer imports it again. The import's builder sandbox isamp-orb-builder-<provider id>: the program and removal delete only a builder with that exact name and the import's mark, never an import of the user's.noHistory, never in the command text. The install saves it in/etc/amp-orbs/key(root only, read by systemd) and runs the installers in a new process without it. Repair rotates it. The app renews it in its last 30 days, in the workspace the read was for, also when the user switched workspaces meanwhile.flock) and keeps the newest key, ranked by expiry then id (orbs::key_rank). Each setup lists the keys after its install and revokes only keys older than its own, and its own key when the provider kept a newer one.orbs::INSTABOX_CLI). Amp's CLI from npm, unpinned.amp login,amp orb provider create instaboxandset-default, so the user copies no token.Amp orbskey, and deletes the provider. Each step must succeed, and a second removal finishes what a failed one left.amp-orbsnames them (amp-orb-base-<time>,amp-orb-snap-<project>-<time>[-<tag>]), never a user's snapshot that only starts alike.amp-orbs-connectkeeps the token thatamp orb provider create instaboxsaved for the Amp server in use, in/var/lib/amp-orbs/provider-token(0600). The provider runs with that token only.UI
API client
create_org_api_key,org_api_keysandrevoke_org_api_key(POST/GET/DELETE /v1/orgs/{id}/keys).delete_snapshot(DELETE /v1/snapshots/{id}).ExecRequestgainsenvsandnoHistory.End-to-end run (2026-12-04 PST, Team workspace, real Amp account)
/etc/amp-orbs/keyroot 0600, not in the env file), sign-in, token saved underorb-provider-token@https://ampcode.com/, service active: OK.amp-orb-base-1796416451ready.amp -ox … --orb-provider instabox): spawn in 15.9 s, 4 vCPU / 8 GB from the base snapshot,amp orb bootstraprunning. Archive → pause in 2.8 s; delete → sandbox deleted in 2.2 s.amp-<thread UUID>, notamp-T-<UUID>, so Open thread did not show.Verify
bun run typecheck,bun run test(255 passed),bun run build.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test: 1040 passed.ade::orca::tests::slow_servers_share_one_deadline_and_one_not_read_hides_no_workfails under full-suite load locally, also on main, and passes alone.instabox,ampandsystemctl.?orbs=setup|signin|connected|free.docs/amp-orbs.mdhas screenshots of it and an Orb sizes section.🤖 Generated with Claude Code